<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%-- 引入页面头 --%>
<%@ include file="/pageHead.jsp"%>

<form name="form1" id="form1" action="" method="post">
	<div class="pageMain">
		<div class="pageTitle"><%=MessageResourcesUtils.getMessage(request, "systemmanage.bascsetting.title") %><span></span><%=MessageResourcesUtils.getMessage(request, "systemmanage.sparticipant.sparticipantList.title") %><span></span><%=MessageResourcesUtils.getMessage(request, "systemmanage.sparticipant.sparticipantUpdate.title") %></div>
		<div class="pageBody">
			<div class="form-group">
			<ul>
					<li>
						<i>*</i>
						<%=MessageResourcesUtils.getMessage(request, "systemmanage.sparticipant.sparticipantList.bankcode") %>
						<span><input type="text" id="bankcode" name="bankcode" class="validate[required,maxSize[10]]" value="${sparticipantbank.bankcode}" /></span>
					</li>
					<li>
						<i></i>
						<%=MessageResourcesUtils.getMessage(request, "systemmanage.sparticipant.sparticipantList.bankname") %>
						<span><input type="text" id="bankfullname" name="bankfullname" readonly="readonly" value="${sparticipantbank.bankfullname}"/></span>
					</li>
				</ul>
				<ul>
					<li>
						<i>*</i>
						<%=MessageResourcesUtils.getMessage(request, "systemmanage.sparticipant.sparticipantList.sparticipantbankno") %>
						<span><input type="text" id="sparticipantbankno" name="sparticipantbankno" class="validate[required,maxSize[10]]" value="${sparticipantbank.sparticipantbankno}"/></span>
					</li>
					<li>
						<i>*</i>
						<%=MessageResourcesUtils.getMessage(request, "systemmanage.sparticipant.sparticipantList.sparticipantfullname") %>
						<span><input type="text" id="sparticipantfullname" name="sparticipantfullname" class="validate[required,maxSize[30]]" value="${sparticipantbank.sparticipantfullname}"/></span>
					</li>
				</ul>
				<ul>
					<li>
						<i>&nbsp;</i>
						<%=MessageResourcesUtils.getMessage(request, "systemmanage.sparticipant.sparticipantAdd.branchcode") %>
						<span><input type="text" id="branchcode" name="branchcode" value="${sparticipantbank.branchcode}" class="validate[maxSize[15]]" /></span>
					</li>
					<li>
						<i>&nbsp;</i>
						<%=MessageResourcesUtils.getMessage(request, "systemmanage.sparticipant.sparticipantAdd.unitcode") %>
						<span><input type="text" id="unitcode" name="unitcode"  value="${sparticipantbank.unitcode}" class="validate[maxSize[15]]"/></span>
					</li>
				</ul>		
			</div>			
        	<div class="button-group">
        		<input type="hidden" name="id" value="${sparticipantbank.id }"/>
        		<input type="hidden" id="bankid" name="bankid" value="${sparticipantbank.bankid}}"/>
       			<input type="button" class="btn btn-default"  id="butSave" name="butSave" value='<%=MessageResourcesUtils.getMessage(request, "common.button.save") %>' />
       			<input type="button" class="btn btn-default"  id="butReturn" name="butReturn" value='<%=MessageResourcesUtils.getMessage(request, "common.button.back") %>' />
			</div>
		</div>
	</div>
</form>

<script type="text/javascript">	
$(document).ready(function() {
	$('#butSave').click(function() {
			var exp = $('#form1').validationEngine('validate');

			if(exp==true)
			{
				// 显示进度条
				showSending();
				$.ajax({
					type: 'POST',
				    url: '${systemctx}/systemmanage/sparticipantbank/validattionSparticipantbank.json',
				    data: $("#form1").serialize(),
				    dataType: 'json',
				    success: function(data)
				    {
				    	//关闭执行...
						closeSending();
				    	if (data.messagetype == '2')
				    	{
				    		//显示AJAX请求后的提示信息
							$.fn.ajaxmessage(data);
				    	}
				    	else
				    	{
				    		form1.action="${systemctx}/systemmanage/sparticipantbank/updateSparticipantbank.web";
							form1.submit();
				    	}
				    }
				});
			}
	});
	
	$('#butReturn').click(function(){
		parent.document.location.reload();
	    $.fn.closeIssWindow();
	});
	
	$("#bankcode").issNewMagnifier({
		title: '<%=MessageResourcesUtils.getMessage(request, "systemmanage.headbank.bankmagnifiertitle") %>',
		url: '${systemctx}/publicMagnifier/publicMagnifier.json',
		sortName : 'modifytime',
		sortOrder : 'desc',
		linkName: 'banknum',
		callSqlKey: 'queryBankMagnifierSql',
		columns:[[
					{title:'<%=MessageResourcesUtils.getMessage(request, "systemmanage.headbank.list.bankcode")%>',field:'banknum',width:180,sortable:true,search:true,align:'left',to:'bankcode'},
					{title:'<%=MessageResourcesUtils.getMessage(request, "systemmanage.headbank.list.bankname")%>',field:'bankname',width:180,search:true,sortable:true,align:'left',formel:'bankfullname'},
					{field:'id',hidden:true,formel:'bankid'}
				]],
		onBeforeOpen:function(p){
	      var queryParams = {
	    		  querybanknum: '%' + $("#bankcode").val() + '%',
	    		  statusid: <%=SysConstant.RecordStatus.VALID %>
	      };
	      return queryParams; 
	    }
	});
	
});
</script>
<%-- 引入页面尾 --%>
<%@ include file="/pageFloor.jsp"%>